home *** CD-ROM | disk | FTP | other *** search
/ Mac Cube 4: Multimedia Applications / MacCube Volume 4: Multimedia Applications.iso / Graphics / Sparkle241 folder / (Docs) / README 2nd < prev    next >
Text File  |  1995-06-08  |  44KB  |  835 lines

  1. Sparkle: A new mac MPEG player.
  2. -------------------------------
  3. Documents for version 2.4.1
  4. This document looks best in 9 point monaco.
  5. On an MPW marks aware editor (like Alpha) this document has marks for 
  6. each section.
  7.  
  8. This document contains the following sections:
  9. INTRODUCTION
  10. LEGALITIES
  11. SAVING TO MPEG
  12. FAQs
  13. WHY DOESN'T SPARKLE DO....
  14. SMALL THINGS YOU MIGHT NOT HAVE NOTICED
  15. THE FUTURE
  16. HOW CAN YOU HELP IMPROVE SPARKLE?
  17.  
  18. ------------------------------------------------------------------------------
  19. INTRODUCTION
  20.  
  21. Hi there, friendly users. This is release 2.4.1 of my mac MPEG player.
  22.  
  23. Version 1.0 of this code was based on the Berkeley MPEG unix code.
  24. (Anyone who wants to play with the Berkeley code can get it from 
  25. toe.cs.berkeley.edu in pub/multimedia/mpeg.) It was released as soon as 
  26. it was usable. This version no longer makes use of Berkeley code and uses 
  27. my own algorithms for greater speed, smaller memory footprint, and more 
  28. flexibility.
  29.  
  30. Version 2.0 of this code made use of the Berkeley MPEG encoder, available 
  31. from the same place as above. This encoding code has now been almost 
  32. completely rewritten by me, and uses substantially less memory than 
  33. before. For this release I merely concentrated on rewriting my own encoder.
  34. As a result, the encoder behaves just like the old encoder except for 
  35. being a little faster and a whole lot less memory intensive.
  36. In the near future I will add rate-controller to the encoder but that's 
  37. not yet ready for this release.
  38.  
  39. Notice that there is a section of this document called FAQs.
  40. Please read it before sending me mail, thus avoiding wasting your time and 
  41. mine.
  42.  
  43. Please read all of this document before playing with the program. While 
  44. actually using the program is pretty simple, there are a few things you 
  45. should be aware of. Many of you may not care when I waffle on about 
  46. technical details. However I would ask all programmer readers (especially 
  47. people knowledgable about QuickTime, and especially Apple [and 
  48. ex-Apple :-( employees] to look at the tech sections and help me out with 
  49. comments and suggestions. Each time someone gives me a pointer on how to 
  50. do something it cuts a week or more off the release date of the next 
  51. version of Sparkle. 
  52.  
  53. Features:
  54. •    Standard mac interface with menus and windows.
  55. •    Uses the QuickTime movie controller to control the MPEG viewing.
  56. •    MultiFinder friendly, with good backgrounding behavior.
  57. •    Saves MPEGs to QuickTime movies.
  58. •    Can open multiple files at once.
  59. •   Can open QuickTime movies and sets of PICTs.
  60. •   Can encode MPEGs.
  61. •     PowerMac native.
  62. •    Free.
  63.  
  64. To run it needs at least:
  65. I do not support Sparkle on less than System 7.5. If you refuse to 
  66. upgrade to 7.5, it is your responsibility to try to track down every 
  67. extension Sparkle needs. I no longer keep track of this info and cannot 
  68. help you in your search.
  69. If you refuse to upgrade to 7.5, here's what you will need.
  70. •    System 7.
  71. •    QuickTime 2.0 (QT 2.0 with the QT PowerPlug on PowerMacs)
  72. •   Sound Manager 3.0.
  73. •    The Thread Manager (2.0 or higher on PowerMacs).
  74. •   ObjectSupportLib and AppleScriptLib on PowerMacs.
  75. •   Works much better with SCSI Manager 4.3
  76. •    A 68020 or better.
  77. •    1200K to play one 160x120 MPEG. Almost all memory allocation is done 
  78.     through temporary memory, so if you get a low memory message, close other 
  79.     applications. Increasing the partition size of Sparkle will not help 
  80.     much and will take memory from other applications.
  81.  
  82. I don't think there's much to say on the use of this program---you pretty 
  83. much run it like any other mac program. There is a section in this 
  84. document on tips that may not be obvious. 
  85. When opening files, you can choose to show all files, or only files with a 
  86. .mpg suffix.
  87. If you choose the "show all files" option and open some random file, don't 
  88. be surprised when you are told that that is not a valid MPEG file.
  89. If you set the option to change file types, the file type of the MPEG file 
  90. you are changing will be changed to a Sparkle file, which will give it a 
  91. nice icon and allow you to open the file by double-clicking on it.
  92.  
  93. Underneath the movie controller for each window is a progress bar which 
  94. will update itself when slow things are happening. If you have a fast 
  95. machine (say a Quadra or Centris) this won't have to update itself much, 
  96. except if you open large (and not too common) MPEGs---say 320x240. If you 
  97. really want to see what the progress update looks like, try having lots of 
  98. MPEGs playing at once, then switch Sparkle into the background. 
  99. If you save an MPEG to QuickTime using Cinepak, your machine may appear to 
  100. freeze while each frame is being converted. I have installed code to 
  101. reduce the extent of the freeze, but basically this is a bug with 
  102. QuickTime---the system just grabs control and won't let go for about five 
  103. seconds. Maybe this'll be fixed in QuickTime 2.0 if we're lucky.
  104.  
  105. I have tested this program extensively under low-memory conditions when it 
  106. opens files and plays them.  It should never crash under those conditions.  
  107. In 600K you can easily open, play and save to QT a 120x160 I-frame MPEG.  In 
  108. 1500K you can open, play and save to QT a 320x240 IBP-frame MPEG.
  109.  
  110. Disk errors in various forms (bad sectors reading an MPEG file, no disk 
  111. space writing an QuickTime file, etc) will not crash, but the system will 
  112. put up an error alert and not handle the error very well (for example you 
  113. won't be given a chance to destroy old files to free up space on a disk). 
  114. Decent recovery from disk errors is on the list of things to do.
  115.  
  116. ------------------------------------------------------------------------------
  117. LEGALITIES
  118.  
  119. This program can be freely distributed.
  120. If you want to include it on a CD-ROM collection, please ask me first, 
  121. but I'll probably allow you.
  122. NOTE: Some authors will not allow their stuff to be distributed on CD-ROMs 
  123. for which people have to pay. I would ask these authors to consider things 
  124. more carefully. Many people (like myself) do not have very good ftp access 
  125. and a CD ROM of stuff is a godsend, even if we do have to pay a little for 
  126. it. Think about it.
  127.  
  128. If you feel a desperate need to thank me for this program, send me a 
  129. floppy of interesting MPEGs or QT movies you've picked up. 
  130. (Please don't e-mail me large files without warning.)
  131. My paper-mail address is 
  132.     Maynard Handley
  133.     20975 Valley Green Drive, Apt 226
  134.     Cupertino, CA 95014
  135.     USA
  136.     
  137. ------------------------------------------------------------------------------
  138. SAVING TO MPEG
  139.  
  140. The dialog box offering options when you save to MPEG is not that great 
  141. right now if you don't know what you're doing. I'm sorry---I'll fix it 
  142. when I have time, like everything else.
  143.  
  144. For a better explanation of how MPEG works, read the Technical Notes file 
  145. in this package, but here are rough details.
  146.  
  147. When encoding your MPEG you will need to decide what types of frames you 
  148. want to use. If you want your MPEG to be read widely, ie on PC systems, 
  149. you should consider using only I-frames. The most common MPEG decoder on 
  150. PCs is the Xing decoder which only understands the simple I-frame MPEG 
  151. format. If you want to get the best possible compression you should use 
  152. I, P and B frames, but then your MPEG will only be able to be read by 
  153. smarter decoders. A compromise is to use only I and P frames. This will 
  154. give you a lot of the compression benefit of I, P and B frames, but will 
  155. be faster to encode. 
  156.  
  157. If you don't want to know the details of these frames, choose a frame 
  158. pattern from the popup menu. 
  159. If you want to create your own frame pattern, here are some details:
  160. (If you don't want to create your own frame pattern, ignore these.)
  161. 1) The first frame in the MPEG will always be I. That implicit I frame is 
  162.     displayed in front of the frame pattern text you enter because it is 
  163.     always there and you don't need to put it in. That implicit I frame is 
  164.     only used for the first frame, after that your pattern is repeated as 
  165.     necessary. Thus if your pattern is BBPBBI, the encoder will encode frames 
  166.     using the sequence I BBPBBI BBPBBI BBPBBI ...
  167.     (For people who care about MPEG details, this is the playback order
  168.     of the frames. The actual order of the frames stored in the file 
  169.     will be be I PBBIBB PBBIBB PBBIBB.)
  170. 2) If you are using B frames, you have to start off with two referential 
  171.     frames, the initial I frame then either an I or a P frame.
  172. 3) The last few frames of the MPEG, if they would be B frames, will be 
  173.     converted to I-frames. (If this didn't occur, like in the original 
  174.     Berkeley encoder code before I munged it, you will lose those final 
  175.     frames.)
  176. 4) Don't create too long a pattern of Ps or Bs. You'll start to lose 
  177.     quality and random access into the movie will become more granular. The 
  178.     presets I've given should guide you as to sensible selections.
  179.  
  180. Once you have chosen a frame pattern, you'll need to select the amount of 
  181. compression you want to use. This is set by the I, P and B quantization 
  182. levels. The values the dialogs gives as defaults will usually make sense 
  183. but if you want to change them:
  184. 1) The values are restricted to the range 1 through 31 inclusive.
  185.     A quantization of 1 is the highest quality, a quantization of 31 is the 
  186.     lowest quality.
  187. 2) Normal quality is a quantization of about 8. Low quality is a 
  188.     quantization of about 16. High quality is about 6.
  189.  
  190. You can choose from various algorithms for generating P and B frames. I 
  191. haven't explored these in detail and they may change when I have time to 
  192. look at them. For now the important things to note are 
  193. 1) They all seem to generate about the same quality, and about the same 
  194.     file size.
  195. 2) They are ordered in the menus by speed, with the fastest ones first.
  196. 3) The B-frame exhaustive search will take approx forever to do anything. 
  197.     Try it once to see what I mean, but don't expect to use it for anything 
  198.     useful.
  199. As I explore these more and start diddling the code, I'll provide more 
  200. explanation.
  201.  
  202. If you save to MPEG, because of the non-causal algorithms used by MPEG 
  203. compression, frames are not compressed in the order they are displayed. 
  204. This means that if you are using B-frames and stop the compression before 
  205. it reaches the end of the source movie, the encoder may have queued up 
  206. some frames it needs to compress to make the MPEG file consistent. 
  207. If this is the case, Sparkle will have to encode those queued frame before 
  208. it stops the compression, so it won't stop immediately. 
  209. The message window will tell you how many frames have been queued so you can see 
  210. how things are going. If you have the speech manager installed, Sparkle 
  211. will also tell you how many frames are left, which you may find more 
  212. convenient.
  213.  
  214. You can set the frame rate from a popup menu. When the dialog box opens, 
  215. the frame rate of the MPEG or QT movie you are converting has its frame 
  216. rate read in and used to set the initial frame rate. So usually you won't 
  217. want to change the frame rate. Note that there are a limited set of frame 
  218. rates because MPEG only supports a very few frame rates. So the best one 
  219. possible is chosen.
  220. Note also that frames are laid down with that frame rate which may cause 
  221. the movie to speed up or slow down. No frame interpolation is done to 
  222. ensure that perception remains correct across frame rate variation. 
  223. This'll be changed at some point, but is not a high priority compared to 
  224. sound.
  225.  
  226. When an MPEG is encoded the frame currently being encoded may be compared 
  227. to the original version of a previous frame, or to what you get when you
  228. decompress the MPEG compressed version of the earlier frame. The latter 
  229. alternative is called ``Decoding Reference Frames''. If you use this 
  230. latter alternative the compression takes a little longer but results in 
  231. files a few percent smaller and slightly better quality. I'd recommend 
  232. you leave this option selected.
  233.  
  234. An MPEG can be encoded using using what are called half-pixels which means 
  235. that some pixels in a P- or B-frame are specified as an average of pixels 
  236. around them.  If you use half-pixels the MPEG created will be a few percent 
  237. smaller than if you don't use half-pixels and the quality will appear 
  238. better IF you play the MPEG on an MPEG player that handles half-pixels.  
  239. However if you use an MPEG player that does not understand half-pixels the 
  240. result may look pretty shabby in places where there is a lot of action.  
  241. Also, using half-pixels makes encoding slower and increases the amount of 
  242. memory used by almost two-thirds. For these reasons I'd recommend not 
  243. selecting this option.
  244.  
  245. ------------------------------------------------------------------------------
  246. MENU OPTIONS
  247.  
  248. Here are various points related to the menu options:
  249.  
  250. • File| Save As: 
  251.     This allows you to start saving a movie or pseduo-movie 
  252.     (made from a set of PICTs) as an MPEG or QuickTime file. Once you start 
  253.     the save it continues in the background. This menu item changes to 
  254.     File| Stop Saving which will stop the saving at once. 
  255.     You may want to pause the saving but not stop it, for example so that 
  256.     you can play another movie at top speed. To pause, simply click anywhere 
  257.     in the movie controller or type any key.
  258.     When the saving is busy working away the movie controller play button 
  259.     shows a pause symbol, because if you click there it will pause the saving.
  260.     When the saving is paused, the movie controller play button shows a play 
  261.     symbol because if you click the saving will resume.
  262. • Image|Grow or Shrink
  263.     The scaling of the window at any time is given in the title bar. 
  264.     When the title starts with *1, the movie is its natural size. 
  265.     With *2 the movie has been doubled in size. 
  266.     With /2 the movie has been halved in size.
  267.     For now if you expand or shrink movies beyond their natural size 
  268.     playback will be much slower and quality may not be as good. I'll be 
  269.     adding code to fix this soonish.
  270.     
  271. • Image| Hide All
  272.     You can hide or show all the decorations below the movie windows. The 
  273.     easiest way to do this is with the tab, shift-tab and control-tab keys, 
  274.     or with command-H. You may want to do this because the decorations 
  275.     irritate you or because hiding the decorations makes playback speed a 
  276.     few percent faster.
  277.  
  278. • Playback| Play All Frames: 
  279.     If this is set, every frame of the movie will be played. The movie will 
  280.     try to play in real time, but may be slower than real time if necessary. 
  281.     It will never be faster than real time. 
  282.     With quicktime movies sound is disabled when this option is on.
  283.     When this option is off, the movie will play back in real time which may 
  284.     mean skipping some frames. For MPEGs, how well this works depends on how 
  285.     fast your mac is. (Also read the section on play rate below.)
  286.     
  287. • Playback| Play at Double Speed or Play at Half Speed:
  288.     These options set the  movie to play twice as fast, at the normal rate, 
  289.     or twice as slowly. Note that if Play All Frames is active, playing the 
  290.     movie at double speed may be no faster than playing it at normal speed 
  291.     because both ways the calculation of each frame is overloading the mac.
  292.     Some MPEGs look jerky and too fast when played at their normal speed and 
  293.     with Play All Frames switched off. This is because the MPEGs have been 
  294.     encoded at too high a frame rate. For example the original movie may 
  295.     been sampled at 12 frames per second but it's encoded as an MPEG of 24 
  296.     (or 23.976) frames per second. This happens because the lowest possible 
  297.     frame rate with MPEG is 23.976 fps. So if this happens, you may want to 
  298.     set the MPEG to play at half speed. 
  299.     You can also control the speed at which movies play by command-clicking 
  300.     in the steppers of the movie controller.
  301.  
  302. • Playback| Set Frame Rate is a generalized version of the above. If you 
  303.     click the Save in File check box, the new frame rate you have chosen 
  304.     will be saved in the MPEG file and used as the default in future. You 
  305.     probably don't want to do that until you've tried the rate and seen that 
  306.     it works properly.
  307.  
  308. • Edit| Preferences| Faster Mode: 
  309.     If you set this option, whenever Sparkle is busy, either playing movies 
  310.     or encoding movies, it will not yield time to background applications. 
  311.     This makes playback a little faster and smoother. 
  312.     However if you have an application doing something in the background,
  313.     for example a modem download or a background compile, you might want to 
  314.     deselect this option.
  315.     By my testing, when Faster mode is on Sparkle uses up about 90% of the 
  316.     CPU. When faster mode is off Sparkle uses up about 70% of the CPU.
  317.     (When Sparkle is in Faster mode it still has to use the EventAvail() trap 
  318.     every so often to see if the user has issued a command, moved the window, 
  319.     grown it or whatever. It's these calls to EventAvail() which can yield the 
  320.     CPU to other processes that suck up the 10% of the CPU not used by 
  321.     Sparkle in Faster mode. Anyone know how to perform the equivalent of 
  322.     EventAvail() without allowing the Process Manager to yield?)
  323.  
  324. • Edit| Strip Resources:
  325.     Sparkle 2.4.1 now stores two types of info in the resource fork of an 
  326.     MPEG file (the MPEG data is all stored in the data fork). The frame rate 
  327.     that you have chosen for the MPEG through the Playback| Set Frame rate 
  328.     dialog is stored. Also stored is all the index info into the MPEG that 
  329.     Sparkle builds the first time it opens the MPEG. This makes opening the 
  330.     MPEG on susbequent occasions faster.
  331.     However there may be reasons why you don't want this information in the 
  332.     resource fork. For example if you are building a Web page and your web 
  333.     software is so dumb it can't handle files with a resource fork, you'll 
  334.     want to strip the resource fork. (If the software is smart enough to 
  335.     send only the data fork of a file and not the resource fork, that is 
  336.     perfect and you won't need to do anything.) 
  337. ------------------------------------------------------------------------------
  338. MPEG PLAYBACK PREFERENCES
  339.  
  340. The MPEG Playback Preferences dialog (use command-R or look under the 
  341. Preferences menu under the Edit menu) allows you to set general playback 
  342. preferences. Most of these are concerned with how you wish to balance 
  343. playback speed against playback quality. Note that whatever settings you 
  344. choose for playback, when you save an MPEG file to another format all 
  345. settings are switched to the highest quality while the save is in 
  346. progress, so you don't need to worry about losing quality that way.
  347.  
  348. • Clip YCrCb:
  349.     What this refers to is an intermediate stage in the MPEG decoding. The 
  350.     values for Y, Cr and Cb should be between 0 and 255 but some MPEGs are 
  351.     encoded so that some Y or Cr or Cb values are calculated to be below 0
  352.     or above 255. If you don't select this option, Sparkle doesn't check the 
  353.     Y Cr Cb values and clip them if they are out of bounds. This makes 
  354.     playback about 10% faster, but may (if the values are out of bounds) 
  355.     lead to dots of incorrect color or black dots in areas of white or 
  356.     suchlike.
  357.  
  358. The other quality options are used depending on the screen depth of the 
  359. screen on which the MPEG is playing. So if your MPEG is on a 16-bit 
  360. screen, the 16-bit color options are used.
  361. • Use 4x4 IDCT:
  362.     One time-consuming part of MPEG decoding is the IDCT which is somewhat 
  363.     like a Fourier transform. This should be performed using a matrix of 8x8 
  364.     coefficients. If you select this option only a 4x4 subset of that matrix 
  365.     will be used. This makes the calculation a lot faster, but the cost is 
  366.     some blurriness to the image which is usually acceptable.
  367. •Use half-pixels:
  368.     Half-pixels are a scheme whereby certain pixels in the image are 
  369.     represented in the MPEG file as an average of nearby pixels. Calculating 
  370.     these averages takes time but improves quality. I'd recommend not 
  371.     bothering with half-pixels on an 8-bit color screen because the dithering 
  372.     hides the fine detail they reveal. For other screen depths you decide.
  373.     Some MPEGs will not be affected by this setting, because they were coded 
  374.     not to use half-pixels.
  375.  
  376. • 24-bit screens display options:
  377.     The high quality setting corresponds to clipping RGB while the faster 
  378.     setting does not clip RGB.
  379.     This is the same sort of issue as the Clip YCrCb note above, only 
  380.     occurring at a later stage in processing. Some MPEGs look fine with 
  381.     neither form of clipping, some only need one or the other, and some need 
  382.     both. (This option is not an issue for 8 and 16 bit screens because they 
  383.     use a different way of calculating RGB for their display---not as high 
  384.     quality as the 24-bit method, but good enough for the given screen 
  385.     depth.)
  386. • 8-bit color screens display options:
  387.     You have a choice of three dither options on an 8-bit screen. 
  388.     * Fast dithering uses an algorithm I invented. It is phenomenally fast, 
  389.     but not the greatest quality. It looks especially bad for things that 
  390.     need very sharp edges, like text. (It also uses 128K of storage to do its 
  391.     thing, so if you're low on space you may want a different option.
  392.     When this option is activated for the first time --- for example when 
  393.     you switch to 8-bit colors screen depth from some other depth, or when 
  394.     you first open an MPEG under 8-bit screen depth --- these 128K of tables 
  395.     have to be calculated which takes about 1.5 sec on my Quadra 610. 
  396.     In a future version of the code I'll implement ideas I have for removing 
  397.     this delay.)
  398.     * Use 16-bit pixmap calculates everything using a temporary 16bit pixmap 
  399.     which is then dithered on the screen using QuickDraw. It's a compromise---
  400.     the quality is better than fast dithering and it uses less memory than 
  401.     the 24-bit scheme.
  402.     * Use 24-bit pixmap works like 16-bit pixmaps, but all calculations are 
  403.     performed on a 24-bit pixmap (using RGB clipping). 
  404.     This gives the best results, but is slower than the 16-bit pixmap case and 
  405.     uses more memory.
  406.     * I hope to improve the quality of the fast dithering algorithm in the 
  407.     near future. 
  408.     * Also at some point I'll add code to allow you to set an optimal palette
  409.     when playing on 8-bit color screens. At present I simply use whatever 
  410.     palette the screen is using, usually the system palette.
  411. • 16-bit screen display options:
  412.     You have three options. 
  413.     * The fast option uses a lookup table directly on the MPEG YCrCb data to 
  414.     get RGB values. This is faster but gives lower quality.
  415.     * The 16bit high-quality option calculates the RGB values properly (with 
  416.     greater precision than using a lookup table). It gives better quality 
  417.     but is slower. (At present I haven't yet written the code for this 
  418.     option so it is disabled.)
  419.     * The 24bit pixmap option calculates results using a 24-bit pixmap (and 
  420.     RGB clipping), then dithers the result to the 16bit screen. It gives the 
  421.     best quality but is slowest.
  422.  
  423. • For 8-bit grey screens:
  424.     Two points to note. 
  425.     * Is your graphics card set to grey mode? If you have a grey screen but in the 
  426.     monitors control panel you have set your graphics card to color, Sparkle 
  427.     will think it's on an 8-bit color screen. This will give you slower 
  428.     playback and lower-quality results.
  429.     * For the fastest possible playback, I assume that the screen palette is 
  430.     set to the system palette. On an 8-bit grey screen there is never any 
  431.     reason to change this. Nonetheless, some applications feel they simply 
  432.     have to perform this pointless exercise whose only effect is to reduce 
  433.     the quality of what's displayed by other applications. (Would you be at 
  434.     all surprised to learn that Word, one of the masterpieces from those 
  435.     geniuses at Redmond, is such an application? I though not.) 
  436.     What this means is that if you are running Word (or another of these 
  437.     ill-behaved applications) in the background, Sparkle will playback MPEG 
  438.     files somewhat slower than it should.
  439.  
  440. In summary: 
  441. The fastest playback possible is on a 8-bit grey screen, followed by 
  442.   8-bit color, then 16-bit color, then 24-bit color. 
  443. For fastest playback, deselect the ClipYCrCb option, 
  444.   select the Use 4x4 IDCT option, 
  445.   deselect the Use Half-Pixels option
  446.   for 8-bit screens use fast dithering 
  447.   for 16bit screens use 16bit fast
  448.   for 24bit screens use 24bit fast
  449.   use command-H to hide all the decorations below the video window.
  450. For highest quality playback, use the deepest screen-depth you can,
  451.   select ClipYCrCb 
  452.   deselect the Use 4x4IDCT option,
  453.   select the Use Half-Pixels option
  454.   select the 24-bit pixmap option
  455.  
  456. Decoding MPEGs requires lots of computation, but can be made faster by 
  457. sacrificing some quality. I've tried to allow you to make your own choice 
  458. about which you prefer. But remember I can't work miracles. For example I 
  459. can't magically give you an 8-bit color dither algorithm that gives the 
  460. same quality as the QuickDraw but runs at the speed of my fast dithering. 
  461. I'll try to improve the quality of the high-speed options in future, but 
  462. I can't promise anything.
  463.  
  464. The one other item in this dialog box is the 
  465. "Prefer 8-bit color to 8 bit-grey" checkbox. This is only relevant to 
  466. people who have more than one screen, at least one of which is grey and 
  467. at least one of which is color. 
  468. When Sparkle opens a file it orders all the screns available by screen 
  469. depth and tries to open a window on the deepest depth screen. But if you 
  470. have one screen set to 8-bit grey and the other set to 8-bit color it 
  471. can't know which you'd prefer, hence this setting. You may prefer the 
  472. color screen because any color is better than none, or the grey screen 
  473. because it gives faster playback and no fuzziness from dithering.
  474. (After ordering the screens by depth, Sparkle notes where other movie 
  475. windows have been placed and tries to place the new window so it doesn't 
  476. overlap any of the old windows. Also, if the window opened is large than 
  477. any screen, it will be opened at half size or whatever so it does fit on 
  478. the screen. I hope you like this algorithm. It works better than what 
  479. every other program I've seen uses. If you have comments about it, please 
  480. mail me.)
  481.  
  482. ------------------------------------------------------------------------------
  483. PICT FILES AND PSEUDO-MOVIES
  484.  
  485. Sparkle can open a set of PICT files to convert them to an MPEG or QT 
  486. movie. This may be useful if you have enough program, like a graphing 
  487. program, that creates a set of PICTs, or if you have a set of medical 
  488. scans or such. 
  489.  
  490. The only picture format Sparkle understands is PICT, the Mac standard 
  491. picture format. I do not plan to change this because there are lots of 
  492. programs out there, many of them free and many of them capable of running 
  493. in batch, that will convert whatever format you have to PICT.
  494.  
  495. Once you have your pictures in PICT format, they need to be in the same 
  496. folder and given the same name so that Sparkle can link them together.  For 
  497. example, if these pictures represent x-rays of your head, call them 
  498. myHead.1, myHead.2, etc.  They must be named name.# where name is common to 
  499. all files and # is a number.  The numbers don't have to start at zero or 
  500. one, and don't have to be contiguous.  However they must all be positive 
  501. integers.
  502.  
  503. From the open files dialog open one of your PICTs---whichever one you get 
  504. to first, it doesn't have to be the lowest numbered one. Sparkle will 
  505. scan the folder for other PICT files with that name and a number added, 
  506. order the files it finds, and display them all in a movie window. 
  507. You can now treat this pseudo-movie like any other movie. You can grow or 
  508. shrink the window, step forwards or backwards, etc. You can play the 
  509. movie if you like, but for these PICT pseudo-movies I set the framerate 
  510. to only one frame per second. Decoding a PICT can be fairly slow---it 
  511. involves disk access and lots of memory---so don't expect this to work 
  512. wonderfully. You can now save the pseudo-movie as an MPEG or QT movie 
  513. just as you would normally.
  514.  
  515. The PICTs may be different sizes, but the window opened will be the size of 
  516. the PICT you select in the open file dialog box. The other PICTs will be 
  517. scaled to fit this size window and may not look too good. I wouldn't 
  518. recommend using a set of PICTs that aren't all the same size.
  519.  
  520. Note that for now I don't do anything special when I draw the pictures. 
  521. In particular this means on screens that aren't 24-bit or 16-bit I don't 
  522. dither the picture. This will be fixed fairly soon. For now everything 
  523. all works and it doesn't affect the quality of movies you create.
  524. I'll also be adding code to save MPEGs or QuickTime movies as a set of 
  525. PICTs fairly soon.
  526.  
  527. ------------------------------------------------------------------------------
  528.  
  529. QUICKEYS AND BATCH CONVERSION
  530.  
  531. I won't have AppleScriptability in place for a few months, but I have 
  532. been asked by some users for a rudimentary support for batch conversions. 
  533. Specifically people wanted a way for Sparkle to indicate that it was done 
  534. encoding a given file.
  535.  
  536. I have provided such a capability for QuicKeys users in a very crude 
  537. fashion. When Sparkle has finished converting a file to a different 
  538. format it will toggle the cursor from the standard arrow cursor to a 
  539. thick cross for one second. 
  540. Note which cross this is: It is not a thin one pixel wide cross, neither is
  541. it a spreadSheet like cross with arms a few pixels wide. This cross has 
  542. arms that are two pixels wide.
  543.  
  544. To use this capability in QuicKeys, you want to put in your sequence a 
  545. Wait..  command. Make the Wait command a WaitForCursor variant, and set 
  546. the options to wait until the cursor becomes ``Other...''. In the 
  547. ``Other'' dialog box choose the appropriate cursor---in my version of 
  548. QuicKeys it's the fourth cursor along. UnSet the Test for Mask box and 
  549. set the Test for Cursor box.
  550.  
  551. I would recommend that you structure your sequence like this:
  552.     Wait ...      ---Wait for the cursor
  553.     Pause...    ---Pause for a second
  554.     Pause...    ---Pause for five seconds or so
  555.     Do your thing.
  556.  
  557. The first pause in the above is to wait until Sparkle finishes its one 
  558. second flash of this cross cursor. The second is to wait for general disk 
  559. activity and such to finish. At that point you can then go on to whatever 
  560. the rest of your sequence does, like maybe close Sparkle then open it 
  561. again with a new file. 
  562.  
  563. ------------------------------------------------------------------------------
  564.  
  565. FAQs (Frequently asked questions).
  566.  
  567. • I try to play MPEGs but my Mac starts speaking numbers or asks me over and 
  568. over to select a voice.
  569.     You have the Speech Manager installed on your Mac including a little 
  570.     extension called ``Speech Media Handler''. Speech Media Handler speaks
  571.     the text of movies that include a text track, and Sparkle plays MPEGs 
  572.     by creating a dummy text track as part of the process of faking QuickTime 
  573.     into accepting MPEGs. I'd recommend ditching Speech Media Handler. I've 
  574.     never seen a place where it is useful and right now it's kinda a cute toy 
  575.     idea that escaped from Apple. Maybe in a few months they'll give it a 
  576.     programmer interface and make it more useful.
  577.     
  578. • I've downloaded (or uploaded) an MPEG using Mosaic/WWW and when I try to 
  579. play it Sparkle says it's not an MPEG file. But if I ftp the file with 
  580. Fetch or suchlike it works fine. What's happening?
  581.     Be very careful when transferring files over the Internet with MacBinary.
  582.     Fetch and many such programs automatically strip MacBinary from files,
  583.     but Mosaic does not appear to (maybe this will be fixed soon). So 
  584.     if an MPEG is stored at a Mosaic site using MacBinary, all Mosaic users
  585.     trying to download it will have problems.
  586.  
  587. • Why does my MPEG have the occasional block of garbage, mostly colored 
  588. green?
  589.     Some part of the MPEG file has become corrupt. This usually happens with 
  590.     MPEG files that have been uuencoded and have had a character or two lost 
  591.     or changed.
  592. • Why are large parts of my MPEG filled with green garbage, or with parts 
  593. of earlier scenes.
  594.     You have probably downloaded the MPEG file using gopher or ftp in ASCII 
  595.     format. The file is now useless. Download it again using BINARY mode. 
  596.     Better still, set your gopher or ftp application always to download .MPG 
  597.     suffix files in BINARY---don't trust its AUTOMATIC mode.
  598. • Why is the first frame of my MPEG all green?
  599.     Some people out there when they create an MPEG file, randomly start it 
  600.     where they feel like it. 
  601.     The consequence is that the first some bytes of the file are garbage and 
  602.     appear as an all green first frame. 
  603.     If you have one of these MPEGs, whenever you jump to the first frame, you 
  604.     won't see the first frame, but simply the last frame you were looking at. This 
  605.     is a consequence of the way Sparkle handles errors in the MPEG file format. 
  606.     Mostly it works well, but in this particular case it isn't great.
  607.     It is not too easy to work around this because of the many different ways
  608.     in which the MPEG can have garbage at the start before valid data begins.
  609.  
  610. • Why at the end of an MPEG is the last frame the same as the second to 
  611. last frame?
  612.     Some MPEGs just are created this way, with the last two frames as 
  613.     duplicates. This is a problem with those files, not a bug in Sparkle, and 
  614.     one just has to accept it. 
  615.     A similar type problem is that some video that's been converted to 30fps 
  616.     from 24fps film has duplicate frames every so often, and agin one just 
  617.     has to accept this for now.
  618.  
  619. • What does the Thread Manager do? Why do you make such a fuss over it?
  620.     The Thread Manager provides a way for a programmer to create a number of 
  621.     tasks within an application and have those tasks all run together. So 
  622.     with Sparkle every time the user asks for something that will takes some 
  623.     time, like playing an MPEG or saving a file in some different format, I 
  624.     create a task that does that work. If the Thread Manager isn't present, 
  625.     you, the user, can't create a number of these tasks and switch between 
  626.     them---you are restricted to doing only one thing at a time.
  627.  
  628. • When I started saving a file to MPEG, it got through two frames then sat there
  629. doing nothing for a long long time. Did it crash?
  630.     Especially when saving to MPEG, Sparkle creates a large number of blocks 
  631.     of memory. If the mac runs out of memory partway through performing 
  632.     this saving, it will run around trying everything it can to scrounge memory.
  633.     On my Quadra 610 I have seen it sit there for 45 seconds trying to free up 
  634.     memory before it concludes that there's nothing it can do and pops up an
  635.     error message. I guess on slower machines it might sit there for up to two
  636.     minutes. Just be patient and wait a while before concluding things
  637.     have crashed.
  638.  
  639. • Where can I get MPEG files?
  640.     An ftp sites is 2k-ftp.CS.Berkeley.EDU in pub/multimedia. 
  641.     (This site used to be called toe.cs.berkeley.edu.)
  642.     
  643.     Here are some WWW sites
  644.     http://www.ccsf.caltech.edu/~johns/sl9.html  (CalTech)
  645.     http://newproducts.jpl.nasa.gov/sl9/images.html  (JPL)
  646.     http://seds.lpl.arizona.edu/sl9/sl9.html  (U. Arizona)
  647.     
  648.     This phillips site sometimes has MPEGs.
  649.     ftp.cdrom.com: /pub/cdrom/incoming
  650.     
  651. • Where can I find more about MPEG?
  652.     Read the UseNet MPEG FAQ. This is published in news.answers every so 
  653.     often, and can be ftp'd as         
  654.         host: ftp.cs.tu-berlin.de
  655.         file: /pub/msdos/windows3/graphics/mpegfaXX.zip
  656.     (XX is a version number).
  657.      Yeah, it's a zip file and that sucks, but that's life. There are a bunch 
  658.      of mac deZip'ers around so grab one and use it.
  659.      The latest version of this file as of July 94 to be 3.1.
  660.  
  661. • How can I deal with AVI files?
  662.     At mac.archive.umich.edu (and probably at sumex) 
  663.     in /mac/graphics/graphicsutil is vfw1.1utilities.sit.hqx
  664.     which handles AVI files and is supposed to work pretty well. 
  665.     I've also been told about 
  666.     ftp://ftp.ctr.columbia.edu:/pub/DA/incoming/vfw11mac.hqx
  667.     which looks the same to me, judging from the name, but which I'm told is 
  668.     better than the above.
  669.  
  670. • What can I do about MPEG sound files?
  671.     Use this program for now, till I include this functionality in Sparkle.
  672.     ftp://mrcnext.cso.uiuc.edu//pub/info-mac/snd/util/mpeg-audio-032.hqx
  673.     Also look at the Internet Underground Music Archive (IUMA) ftp site, 
  674.     sunsite.unc.edu (152.2.22.81) /pub/electronic-publications/IUMA
  675.     for various MPEG audio files and code/apps for a variety of machines.
  676.  
  677. ------------------------------------------------------------------------------
  678. WHY DOESN'T SPARKLE DO...
  679.  
  680. •    Why doesn't Sparkle read .gl, .dl and .fli files?
  681. One reason is that those file formats are awful. They give these dinky 
  682. low contrast horribly dithered images no-one would want to look at, and 
  683. they usually only have about 10 frames. Maybe, years from now, I'll add 
  684. those conversions, but they're about as low a priority as you get.
  685. At mac.archive.umich.edu (and probably at sumex)
  686. in /mac/graphics/graphicsutil is macanimviewer1.05.sit.hqx 
  687. which handles these various cheapo formats so you might want to grab it.
  688.  
  689. •    What about audio?
  690. MPEG has audio compression as well as video compression. I've been doing 
  691. lots of reading into this and pretty soon will start coding for it.
  692.  
  693. •    What about Video for Windows?
  694. I would be nice to support .AVI files. But right now I know nothing about 
  695. .AVI beyond the fact that it exists. Again any info anyone has is 
  696. appreciated. Until I know how .AVI works, how it fits into the windows 
  697. environment etc, I can't even tell you if it's practical for Sparkle to 
  698. try to support .AVI, let alone start the necessary coding.
  699.  
  700. •    Why don't you write an MPEG codec?
  701. MPEG support under QT is through the emchanism of a new Media Handler, not 
  702. simply a codec. This si being worked on but it's a  non-trivial problem.
  703.  
  704. ------------------------------------------------------------------------------
  705. SMALL THINGS YOU MIGHT NOT HAVE NOTICED
  706.  
  707. The movie controller behaves pretty much like a standard QT controller. 
  708. You can step forward and backwards, hold down those buttons to play 
  709. forwards or backwards and click or drag in the central region to go to a 
  710. random point. 
  711. You can use the forward and backward arrow keys to step. 
  712. You can option click in the forward and backward steppers to go to the 
  713. beginning or end of the MPEG. Likewise using option forward or backward 
  714. arrow.
  715. You can start the movie playing using either return, spacebar, or 
  716. command forward arrow. You can stop playing using spacebar or return.
  717. You can yet play backwards by using command backward arrow. 
  718.  
  719. The visual clue that the movie is being saved is that 
  720. the movie controller loses its controls and shows only a relative position. 
  721. This is not a particularly obvious fact and may at some point be changed. 
  722. For now it works once you realize this fact.
  723.  
  724. When a movie is being saved, you can either stop the conversion 
  725. or pause it. To stop the conversion, use command-S (or the equivalent 
  726. menu option.) This will save the movie using the frames created so far.
  727. To pause the conversion use command-P, or the equivalent menu option, or 
  728. click in the movie controller. 
  729. The  saving will stop until you start that movie playing again. This is 
  730. occasionally useful if you want to pause a cinepak conversion to do a 
  731. short job on your mac.
  732. You can tell whether a movie is actively being saved or paused being 
  733. saved by looking at the indicator in the title bar. 
  734. If the first character in the title bar is 
  735.   S the movie is actively being saved,
  736.   P the movie is paused being saved,
  737.   R the movie is in realtime playback mode
  738.   A the movie is in play-all-frames playback mode.
  739.  
  740. If you are partway through a movie and save, the movie will be 
  741. rewound to the beginning for you. You do not need to be at the start of a 
  742. movie to save.
  743.  
  744. You can save only part of a movie by selecting that portion (using the 
  745. shift key and the arrow keys or the mouse), then hitting command-S.
  746.  
  747. You can set the temporal quality options when saving to QuickTime 
  748. separately from the spatial quality options. If you need to do this, hold 
  749. down the option key while using the quality slider, and it will become a 
  750. temporal quality slider. 
  751.  
  752. ------------------------------------------------------------------------------
  753. THE FUTURE
  754.  
  755. The basic outline for now is
  756.     2.5 Cleaned up faster, smaller version of 2.0.
  757.     3.0 Handles sound.
  758.     3.5 Cleaned up faster, smaller version of 3.0.
  759. While adding these large additions I'll fix small things as I go, and as 
  760. I have time. I don't see the user interface improving much for some 
  761. time---more important things need my time.
  762.  
  763. I also want to add stuff to allow us to create movies. Morphs, special 
  764. effects, that sort of thing.
  765.  
  766. ------------------------------------------------------------------------------
  767. HOW CAN YOU HELP IMPROVE SPARKLE?
  768.  
  769. •    Any info on psycho-acoustic encoding?
  770. •    Any info on Microsoft Video for Windows?
  771. •    Any bug reports.
  772. •    Any ideas you have or suggestions. Your suggestions may go onto the 
  773.     list of things to do (currently two pages of single line items) but will 
  774.     probably be acted upon at some point. People have suggested several 
  775.     things to me I would not have thought of myself, so I do want your 
  776.     feedback.
  777. ------------------------------------------------------------------------------
  778. THANKS
  779.  
  780. * Many people all over the internet have helped me write this code.
  781. * Thanks to the people at Berkeley. Even though I've completely replaced 
  782.     their MPEG playback code with my own, they helped get this project started.
  783.     And, until I rewrite it, I'm using their MPEG encoding code.
  784. * Thanks to various usenet personalities who answered mac programming 
  785.     questions, mailed me quicktime header files and such. Special thanks to 
  786.     ldo in New Zealand, and Jon W{tte in Sweden, and bryanw, keeper of the 
  787.     MPEG FAQ, who mailed me about the Stanford MPEG encoder.
  788. * A special individual thank you goes to DS (he didn't want me to give his 
  789.     name but he knows who he is.) DS mailed me a CD ROM and ten floppies of 
  790.     information about QuickTime components after I complained that Apple was 
  791.     not making this information easily available. He's also provided me with 
  792.     information on QT 2.0 which will gradually be assimilated into Sparkle.
  793. * Thanks to Gene Chalfant who passed on a paper from NASA containing some 
  794.     interesting ideas on IDCT alternatives. 
  795. * Thanks to the mystery person in Britain who sent me some QT 2.0 
  796.     information in an envelope with no name attached to it.\
  797. * Thanks to Jamie McCarthy for code for touching Finder folders.
  798. * Thanks to Troy Gaul for the Infinity Windoid.
  799. * Thanks to Richard Lim for the current set of icons used by Sparkle.
  800.     (Which I modified a little so it's probably best to blame me rather than 
  801.     him for poor design choices if you don't like them.)
  802. * Thanks to Stuart Cheshire for mailing me a QT 2.0beta CD-ROM and misc 
  803.     useful info.
  804. * Thanks to everyone who's mailed in bug reports or suggestions. Even when 
  805.     I can't implement suggestions at once, they go on the list for inclusion 
  806.     in a few months. 
  807. * Thanks to Apple for making the greatest computers in the world. 
  808.     (Though sadly they seem to be going completely clueless with regard to 
  809.     how to distribute their various new ideas. I fear if they don't get their 
  810.     act together about this soon, NO-ONE will support these new things 
  811.     because developers will have no idea whose machine has what on it.)
  812. * Thanks also to Symantec for creating such a great programming environment.
  813.     This program was written with Think C 5, then Think C 6  and now Think C 7 
  814.     using the Think Class Library. Having coded on Windows, X-windows, and 
  815.     the Mac, I can unreservedly say that the Mac is by far the most pleasant 
  816.     platform for a programmer.
  817. * Thanks to Richard Cowgill for providing me with the cool looking 
  818.     picture to use for a startup screen.
  819. * Thanks to Stuart Cheshire (again!) for nagging me about very MPEGs in 
  820.     very small windows and getting me to make the window-shrinking code behave
  821.     a little nicer.
  822. * Thanks to Chris Petersen for the nice new Sparkle folder icon.
  823. * Thanks to Apple (again!) for sending me a PowerMac to use so I could 
  824.     code up a native version.
  825. * Thanks to everyone who submitted bug reports and ideas. 
  826. * Thanks to Frank Hauptmann who sent me a Video-CD so I can test Sparkle 
  827.     and my MPEG code against it.
  828.  
  829. (If I've forgotten your name here by mistake and you really deserve to be 
  830. here, please remind me.)
  831.  
  832. Maynard Handley 
  833. maynard@elwing.otago.ac.nz
  834. March 14 1995
  835.